<html>
<head>
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p class="heading">
menuItem element (used with <a href="interfacedoc.html">Interface</a> module)
</p>
<p class="subheading">
Description:
</p>
<p>
This element is used to create menus. You create menuItems, then add them to a
<a href="menudoc.html">menu</a> object, which is in turn added to another menu
or an <a href="interfacedoc.html">interface</a> object.
</p>
<p class="subheading">
To use:
</p>
<p>
The code for this element is included in the <a href="interfacedoc.html">interface module</a>,
linked as follows:
</p>
<p class="jcode">
&lt;script language="Javascript" src="gamelib_interface.js"&gt;&lt;/script&gt;
</p>
<p>
You then instantiate a menuItem object by adding the following to your script:
</p>

<p class="jcode">
myMenuItem=new In_MenuItem('Open','alert(\'open\')',true);
</p>

<p>
The parameters to pass as this object is constructed are firstly the text to display for this
menu item, then the action to be performed when it's clicked, and finally true (the third parameter
is always true in this version of gamelib.) After you've done this, you must add the menuItem to 
a <a href="menudoc.html">menu</a> object, and that menu object must be added to an <a href="interfacedoc.html">Interface</a>
before it can be used.
</p>

<p class="subheading">
List of methods for menuItem
</p>

<p>
<a href="#disable">disable</a><br>
<a href="#enable">enable</a><br>
<a href="#setAction">setAction</a><br>
</p>

<p class="subheading">
Descriptions of methods for menuItem
</p>

<table>
<tr>
<th>Method</th><th NOWRAP>Parameters</th><th>Description</th>
</tr>

<tr>
<a name="disable">
<td>disable</td><td>(none)</td><td>
Disables this menuItem. The item is still displayed in the menu, but it uses the disabled background
colour set in its parent <a href="menudoc.html">menu</a> object, and will not respond to the mouse.
</td>
</tr>

<tr>
<a name="enable">
<td>enable</td><td>(none)</td><td>
Re-enables the menuItem. This is the default state for all menuItems.
</td>
</tr>

<tr>
<a name="setAction">
<td>setAction</td><td>String</td><td>
Sets the action to be performed when the menuItem is clicked. This could be any legal javascript
statement, but would normally be used to call a function in the main script.
</td>
</tr>

</table>


</body>
</html>